package com.ants.frame;

import com.ants.listener.JFileChooserListener;

import javax.swing.*;
import java.awt.*;

/**
 * @author 蚂蚁会花呗
 * @date 2021/11/3 14:02
 */
public class JFileChooserFrame extends JFrame{
    JTextField labfilepath;
    JPanel jp1,jp2;
    JButton jb1,jb2;





    public JFileChooserFrame(JTextField jtf1,JTextField jtf2,JPasswordField jtf3) {

        jp1 = new JPanel();
        jp2 = new JPanel();

        labfilepath = new JTextField(30);



        jb1 = new JButton("浏览");
        jb2 = new JButton("确定");

        this.setLayout(new GridLayout(2, 1));

        jp1.add(jb1);
        jp1.add(labfilepath);
        jp2.add(jb2);

        this.add(jp1);
        this.add(jp2);

        setTitle("选择导出路径");
        setSize(500, 200);
        setVisible(true);
        labfilepath.setEditable(false);
        this.setLocationRelativeTo(null);//窗体居中显示

        //监听浏览按钮
        new JFileChooserListener(jb1,jb2,labfilepath,jtf1,jtf2,jtf3);

    }

}
